package com.example.zhu.service.Impl;

import com.example.zhu.entity.Manage;
import com.example.zhu.mapper.HelperMapper;
import com.example.zhu.service.HelperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HelperServiceImpl implements HelperService {


    @Autowired
    private HelperMapper helperMapper;
    /**
     * 登录
     *
     * @param key
     * @return
     */
    public Integer login(String key) {

        /**
         *  1是取快递的 0是送快递的
         */
        Manage manage = helperMapper.selectByTakeKey(key);

        if(manage == null){
            Manage manage_ = helperMapper.seletBySendKey(key);
            if(manage_ == null){
                return -1;
            }else {
                return 0;
            }
        }else {
            return 1;
        }

    }
}
